<?php
/**
 * @package LaravelBoot
 *
 * @internal
 *
 * @author mawenpei
 * @date 2019/3/12 18:43
 * @version
 */
namespace Modules\ApiV2\Controllers;

use Illuminate\Routing\Controller;

class BaseController extends Controller
{

    /**
     * 请求成功
     * @param object|array|null $data
     * @return \Illuminate\Contracts\Routing\ResponseFactory|\Symfony\Component\HttpFoundation\Response
     */
    protected function success($data = null)
    {
        return success($data);
    }
    /**
     * 请求失败
     * @param int $code
     * @param string $msg
     * @return \Illuminate\Contracts\Routing\ResponseFactory|\Symfony\Component\HttpFoundation\Response|void
     */
    protected function fail($code = 400, $msg = 'fail')
    {
        return fail($code,$msg);
    }
}